##						  ##
# Neptenthes Check monitor #
##						  ##

import commands

class monNep:
    def __init__(self):
        self.name="nepenthes malware monitor"
        self.result=""
        self.type="MLW"
        self.bincount=0
        self.hexcount=0
    def check(self):
        self.result=""
        #bin check
        bcount=commands.getoutput("ls /var/lib/nepenthes/binaries/ | wc -l")
        #hexdump check
        hcount=commands.getoutput("ls /var/lib/nepenthes/hexdumps/ | wc -l")
        alert=0
        if(bcount>self.bincount):
            alert=1
            self.bincount=bcount
            self.result="New malware binary!"
        if(hcount>self.hexcount):
            alert=1
            self.hexcount=hcount
            self.result+="\nNew malware hexdump!"
        if(alert==1):
            return 1
        else:
           return 0
        
